﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Mainpage.aspx.cs" Inherits="aspnet2.User.Mainpage"  MaintainScrollPositionOnPostback="true" Trace="false" TraceMode="SortByCategory" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <style type="text/css">

.STYLE1
{
    color: #FFFFFF;
    font-family:楷体_GB2312
    font-size: 12px;
    font-style: normal;
    line-height: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    text-decoration: none;
}
        .style3
        {
            height: 28px;
        }
        .style3
        {
            color: #999999;
            font-family: "宋体";
            font-size: 12px;
            font-style: normal;
            line-height: 22px;
            font-weight: normal;
            font-variant: normal;
            text-transform: none;
            text-decoration: none;
            width: 186px;
        }
        .STYLE3
{
    color: #999999;
    font-family: "宋体";
    font-size: 12px;
    font-style: normal;
    line-height: 20px;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    text-decoration: none;
    border-top-width: 1px;
    border-top-style: solid;
    border-top-color: #999999;
}

    </style>
</head>
<body>
    <form id="form1" runat="server" visible="True" title="产品购买">
    <asp:ScriptManager ID="ScriptManager1" runat="server" >
    </asp:ScriptManager>
    <asp:Label ID="ErrorInfo" runat="server"></asp:Label>
    <br />
    <asp:Panel ID="Panel2" runat="server">
        <table width="1001" height="50" border="0" align="center" cellpadding="0" 
    cellspacing="0">
            <tr>
                <td width="202" background="../Image/08a.gif" bgcolor="#000000">
                    &nbsp;
                </td>
                <td width="638" bgcolor="#000000">
                    <asp:LinkButton ID="UserSpace" runat="server" onclick="UserSpace_Click" 
                        ForeColor="#B2B2B2">首页</asp:LinkButton>
                    &nbsp;&nbsp;
                    <asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click" 
        Visible="False" ForeColor="#B2B2B2">我的管理空间</asp:LinkButton>
                    &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" ForeColor="#B2B2B2" 
                        onclick="LinkButton2_Click">我的空间</asp:LinkButton>&nbsp;<asp:LoginStatus 
                        ID="LoginStatus1" runat="server" ForeColor="#B2B2B2" />
                    &nbsp;</td>
                <td width="80" align="left" valign="middle" bgcolor="#000000" class="STYLE1">
                    &nbsp;</td>
            </tr>
        </table>
        <table width="1000" height="75" border="0" align="center" cellpadding="0" 
    cellspacing="0">
            <tr>
                <td width="202" background="../Image/08.gif" bgcolor="#000000">
                    &nbsp;
                </td>
                <td width="114" align="right" valign="bottom" 
                background="../Image/01.gif" bgcolor="#000000">
                    <table width="80" height="45" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td align="left" valign="top">
                                <a style="color: #B2B2B2" href="/InfoMation/Company.aspx"> 公司简介</a>
                                =</td>
                        </tr>
                    </table>
                </td>
                <td width="114" align="right" valign="bottom" 
                background="../Image/02.gif" bgcolor="#000000">
                    <table width="80" height="45" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td align="left" valign="top">
                                
                                <a style="color:#B2B2B2" href="/User/Mainpage.aspx">产品展示</a></td>
                        </tr>
                    </table>
                </td>
                <td width="114" align="right" valign="bottom" 
                background="../Image/03.gif" bgcolor="#000000">
                    <table width="80" height="45" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td align="left" valign="top" class="STYLE1">
                                                           <a style="color:#B2B2B2" href="/InfoMation/PrintedProduct.aspx">成品展示</a>
                            </td>
                        </tr>
                    </table>
                </td>
                <td width="114" align="right" valign="bottom" 
                background="../Image/04.gif" bgcolor="#000000">
                    <table width="80" height="45" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td align="left" valign="top" class="STYLE1">
                                  <a style="color:#B2B2B2" href="/InfoMation/Certification.aspx">专利认证</a>
                            </td>
                        </tr>
                    </table>
                </td>
                <td width="114" align="right" valign="bottom" 
                background="../Image/05.gif" bgcolor="#000000">
                    <table width="80" height="45" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td align="left" valign="top">
                               
                                <a style="color:#B2B2B2" href="/InfoMation/VedioDemo.aspx">视频演示</a>
                            </td>
                        </tr>
                    </table>
                </td>
                <td width="114" align="right" valign="bottom" 
                background="../Image/06.gif" bgcolor="#000000">
                    <table width="80" height="45" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td align="left" valign="top">
                             
                                <a style="color:#B2B2B2" href="/InfoMation/TechSupport.aspx">服务与支持</a>
                            </td>
                        </tr>
                    </table>
                </td>
                <td width="114" align="right" valign="bottom" 
                background="../Image/07.gif" bgcolor="#000000">
                    <table width="80" height="45" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td align="left" valign="top">
                                <a style="color:#B2B2B2" href="/InfoMation/ContactUs.aspx">联系我们</a>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <table width="1000" height="220" border="0" align="center" cellpadding="4" cellspacing="4"
        bordercolor="#000000" >
            <tr>
                <td width="945" align="center" valign="middle" bgcolor="#999999">

                    <script language="JavaScript">
 
<!--                    // BannerAD 

                    var bannerAD = new Array();
                    var bannerADlink = new Array();
                    var adNum = 0;
                    //修改下面的图片地址和相应的链接地址
                    bannerAD[0] = "../image/1.jpg";
                    bannerADlink[0] = "";
                    bannerAD[1] = "../image/2.jpg";
                    bannerADlink[1] = "";
                    bannerAD[2] = "../image/3.jpg";
                    bannerADlink[2] = "";

                    var preloadedimages = new Array();
                    for (i = 1; i < bannerAD.length; i++) {
                        preloadedimages[i] = new Image();
                        preloadedimages[i].src = bannerAD[i];
                    }

                    function setTransition() {
                        if (document.all) {
                            bannerADrotator.filters.revealTrans.Transition = Math.floor(Math.random() * 23);
                            bannerADrotator.filters.revealTrans.apply();
                        }
                    }

                    function playTransition() {
                        if (document.all)
                            bannerADrotator.filters.revealTrans.play()
                    }

                    function nextAd() {
                        if (adNum < bannerAD.length - 1) adNum++;
                        else adNum = 0;
                        setTransition();
                        document.images.bannerADrotator.src = bannerAD[adNum];
                        playTransition();
                        theTimer = setTimeout("nextAd()", 5000);
                    }

                    function jump2url() {
                        jumpUrl = bannerADlink[adNum];
                        jumpTarget = '_blank';
                        if (jumpUrl != '') {
                            if (jumpTarget != '') window.open(jumpUrl, jumpTarget);
                            else location.href = jumpUrl;
                        }
                    }
                    function displayStatusMsg() {
                        status = bannerADlink[adNum];
                        document.returnValue = true;
                    } 

//--> 
                </script>

                    <script language="JavaScript">
                    nextAd()</script>

                    <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Image/1.jpg" 
                        Width="987px" />
                </td>
            </tr>
        </table>
    </asp:Panel>
    <br />
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" DataSourceID="LinqDataSource1" 
        style="margin-right: 55px" DataKeyNames="Type" BorderStyle="None">
        <Columns>
            <asp:TemplateField HeaderText="商品">
                <ItemTemplate>
                    <asp:ImageButton ID="ImageButton2" runat="server" 
                        ImageUrl='<%# Eval("ImgURL") %>' onclick="ImageButton2_Click" />
                    <br />
                    <asp:Label ID="Label5" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                    <br />
                    <asp:Label ID="Label6" runat="server" Text='<%# Eval("CurrentPrice") %>'></asp:Label>
                    <asp:Button ID="Button5" runat="server" 
                        style="height: 26px" Text="购买" UseSubmitBehavior="False" Width="40px" 
                        onclick="Button5_Click" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <br />
                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                        <ContentTemplate>
                            <asp:Panel ID="Panel1" runat="server" Visible="False">
                                <asp:Label ID="ItemName" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                                <asp:Label ID="ItemID" runat="server" Text='<%# Eval("ID") %>' Visible="False"></asp:Label>
                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                <asp:Button ID="Button6" runat="server" onclick="Button6_Click" Text="关闭" />
                                <br />
                                <asp:Label ID="Label3" runat="server" Text="单价"></asp:Label>
                                <asp:Label ID="Price" runat="server" Text='<%# Eval("CurrentPrice") %>'></asp:Label>
                                <br />
                                <asp:Label ID="Quantity" runat="server" Text="数量"></asp:Label>
                                <asp:TextBox ID="QuantityBox" runat="server"></asp:TextBox>
                                <asp:CompareValidator ID="CompareValidator1" runat="server" 
                                    ControlToValidate="QuantityBox" Display="Dynamic" ErrorMessage="必须为数字" 
                                    Operator="DataTypeCheck" Type="Integer"></asp:CompareValidator>
                                <cc1:ValidatorCalloutExtender ID="CompareValidator1_ValidatorCalloutExtender" 
                                    runat="server" Enabled="True" TargetControlID="CompareValidator1">
                                </cc1:ValidatorCalloutExtender>
                                <br />
                                <asp:DropDownList ID="InkColor" runat="server" DataSourceID="SqlDataSource1" 
                                    DataTextField="ColorName" DataValueField="ColorName" Visible="False">
                                </asp:DropDownList>
                                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                                    ConnectionString="<%$ ConnectionStrings:PrintershopConnectionString3 %>" 
                                    SelectCommand="SELECT [ColorName] FROM [InkColor]"></asp:SqlDataSource>
                                <asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="放入购物篮" />
                                <br />
                                <asp:Label ID="Label4" runat="server" Text="Messege" ForeColor="#FF3399" 
                                    Visible="False"></asp:Label>
                                <br />
                                <asp:Button ID="Button3" runat="server" onclick="Button3_Click" 
                                    Text="取消上一次操作" />
                                <br />
                                <asp:Button ID="Button4" runat="server" Height="25px" onclick="Button4_Click" 
                                    style="margin-left: 0px" Text="结算" />
                            </asp:Panel>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                    <br />
                    <br />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
        ContextTypeName="aspnet2.DataClasses1DataContext" OrderBy="Type, CurrentPrice" 
        Select="new (Name, ID, CurrentPrice, PriceUnit, Unit, Machine, Ink, Warranty, Certification, ImgURL, Img, Type)" 
        TableName="Product" Where="Type &lt; @Type">
        <WhereParameters>
            <asp:Parameter DefaultValue="3" Name="Type" Type="Int32" />
        </WhereParameters>
    </asp:LinqDataSource>
    <table width="1000" height="80" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td align="center" valign="middle" class="STYLE3">
                <p>
                    成都市春之晖祥科技有限公司 Copyright@2006-2008版权所有 <a href="http://www.miibeian.gov.cn/" 
                        target="_blank" class="STYLE1">
                        备案编号:粤ICP备09041566</a>
                    <br />
                    公司地址：成都市小南街冠城国际花园檀香阁4F
                    <br />
                    销售热线：028-85551649 传真：028-85530847</p>
            </td>
        </tr>
    </table>
    <br />
    </form>
</body>
</html>
